<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
	<head>
		<title>页面标题</title>
		<%@ include file="/commons/meta.jsp"%>
		<script language=javascript src="${ctx}/scripts/date/wpCalendar.js"></script>
		<script language="JavaScript" src="${ctx}/scripts/home/common.js"></script>
		
		<script type="text/javascript">
			/**验证和提交表单*/
			function validate(){
				var msg = "";
				var name = document.ProcessTransitionForm.name.value;
				if(name == "") {msg += "--名称不能为空;\n";} else if(name.length > 20){msg += "--名称长度不能超过20个字符;\n";}

				var proInsId = document.ProcessTransitionForm.proInsId.value;
				var proInsIdP = /^[0-9]{1,20}$/;
				if(!proInsIdP.exec(proInsId)){msg += "--流程实例ID必须为数字;\n";}

				var startTaskFlag = document.ProcessTransitionForm.startTaskFlag.value;
				if(startTaskFlag == "") {msg += "--开始节点标识不能为空;\n";} else if(startTaskFlag.length > 20){msg += "--开始节点标识长度不能超过20个字符;\n";}

				var endTaskFlag = document.ProcessTransitionForm.endTaskFlag.value;
				if(endTaskFlag == "") {msg += "--结束节点标识不能为空;\n";} else if(endTaskFlag.length > 20){msg += "--结束节点标识长度不能超过20个字符;\n";}

				var status = document.ProcessTransitionForm.status.value;
				if(status == "") {msg += "--状态不能为空;\n";} else if(status.length > 20){msg += "--状态长度不能超过20个字符;\n";}

				if(msg != "") {alert(msg);} else {document.ProcessTransitionForm.submit();}

			}
			
			function winclose(){
			    if(isWinClose()){
			      validate();
			    }else{
			       history.back();
			    }
			}
		</script>
	</head>
	<body>

		<div class="albox">
			<!--统一信息头部开始-->
			<ul>
				<li>
					<img src="${templateVo.styleImagePath}/list9.gif" />
				</li>
				<li style="width: 99%">
					<table width="100%" border="0" cellspacing="0" cellpadding="0"
						align="center" class="albox1">
						<tr>
							<td width="2%" align="right" height="31">
								<img src="${templateVo.styleImagePath}/ico_clock3.gif" />
							</td>
							<td width="4%">
								<a href="javascript:void(validate())">保存</a>
							</td>
							<td width="2%">
								<img src="${templateVo.styleImagePath}/ico_clock1.gif" />
							</td>
							<td width="4%">
								<a href="javascript:void(winclose())">返回</a>
							</td>
							<td width="84%"></td>
						</tr>
					</table>
				</li>
				<li style="float: right;">
					<img src="${templateVo.styleImagePath}/list10.gif" />
				</li>
			</ul>
			<!--统一信息头部结束-->
		</div>

		<div style="width: 98%; float: left;">
			<table width="98%" border="0" cellspacing="0" cellpadding="0"
				align="center">
				<tr>
					<td class="edittit" align="center">
						XX编辑
					</td>
				</tr>
				<tr>
					<td align="center">
						&nbsp;
					</td>
				</tr>
			</table>
			<html:form action="/ProcessTransitionAction.do" styleClass="form">
				<input type="hidden" name="method" value="save" />
				<html:hidden property="id" />
				<table width="98%" border="1" cellspacing="1" cellpadding="2">
				    
					<tr class=tr001>
						<td width=12% class='text12_1' align=right bgcolor='#F7F7F7'>名称：</td>
						<td bgcolor='#Ffffff'><html:text property="name" styleClass="text"/><font color=red>(*)</font></td>
					</tr>
					<tr class=tr001>
						<td width=12% class='text12_1' align=right bgcolor='#F7F7F7'>流程实例ID：</td>
						<td bgcolor='#Ffffff'><html:text property="proInsId" styleClass="text"/><font color=red>(*)</font></td>
					</tr>
					<tr class=tr001>
						<td width=12% class='text12_1' align=right bgcolor='#F7F7F7'>开始节点标识：</td>
						<td bgcolor='#Ffffff'><html:text property="startTaskFlag" styleClass="text"/><font color=red>(*)</font></td>
					</tr>
					<tr class=tr001>
						<td width=12% class='text12_1' align=right bgcolor='#F7F7F7'>结束节点标识：</td>
						<td bgcolor='#Ffffff'><html:text property="endTaskFlag" styleClass="text"/><font color=red>(*)</font></td>
					</tr>
					<tr class=tr001>
						<td width=12% class='text12_1' align=right bgcolor='#F7F7F7'>状态：</td>
						<td bgcolor='#Ffffff'><html:text property="status" styleClass="text"/><font color=red>(*)</font></td>
					</tr>

				</table>
			</html:form>
		</div>
	</body>
</html>
